package practical_projects.games.submarine_war;

import javax.swing.ImageIcon;

public class Mine extends Weapon {     // 水雷
    public Mine(int x, int y) {
        super(11, 11, x, y, 2);
    }

    @Override
    public void move() {
        y -= speed;
    }

    @Override
    public ImageIcon getImage() {
        return Images.mine;
    }

    public boolean collisionDetection() {     // 碰撞检测
        if (y <= World.seaLevel && x + width >= World.battleship.x &&
                x <= World.battleship.x + World.battleship.width)
            return true;
        return false;
    }
}
